package com.test.spring2025_4_3.Controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/producer")
@RestController
@Slf4j
public class RabbitController {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    @RequestMapping("/quorum")
    public void quorum() {
        rabbitTemplate.convertAndSend("","quorum","hello quorum test...");
    }

    @RequestMapping("haproxy")
    public void haproxy(){
        rabbitTemplate.convertAndSend("","haproxy.queue","hello haproxy...");
    }
}
